package com.itheima.array;

/**
 * 数组的遍历
 */
public class ArrayPractise03 {
    public static void main(String[] args) {
        int[] arr = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
        //数组的遍历
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
        System.out.println();
            //数组的遍历-求和 小练习
            int[] arr1 ={16,26,36,6,100};
            //求和
            //定义一个变量来存储和
            int sum = 0;
            //遍历数组
            for (int j = 0; j < arr1.length; j++) {
                sum += arr1[j];
            }
            System.out.println("销售额的和为");
            System.out.println(sum);

    }
}
